﻿
#include <iostream>
#include "gtest\gtest.h"

#include "Common/common.h"

int add(int a, int b)
{
    return a + b;
}

// TEST使用
TEST(testCase, test0)
{
    EXPECT_EQ(add(2, 3), 5);
}

// TEST_F使用
class TestCaseExample : public testing::Test {
protected:
    static void SetUpTestSuite()
    {
        std::cout << "run before first case..." << std::endl;
    }

    static void TearDownTestSuite()
    {
        std::cout << "run after last case..." << std::endl;
    }

    virtual void SetUp() override
    {
        std::cout << "enter into SetUp()" << std::endl;
    }

    virtual void TearDown() override
    {
        std::cout << "exit from TearDown" << std::endl;
    }
};

TEST_F(TestCaseExample, test0)
{
    CodingSea::TString str = _T("abc");
    str.at(0) = 'd';
    EXPECT_STREQ(str.c_str(), _T("dbc"));
}
